<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="robots" content="noodp" />
        <title>主题文档 - mermaid Shortcode - KeepIt</title><meta name="Description" content="mermaid shortcode 使用 Mermaid 库提供绘制图表和流程图的功能."><meta property="og:title" content="主题文档 - mermaid Shortcode" />
<meta property="og:description" content="mermaid shortcode 使用 Mermaid 库提供绘制图表和流程图的功能." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://example.com/theme-documentation-mermaid-shortcode/" /><meta property="og:image" content="https://example.com/theme-documentation-mermaid-shortcode/featured-image.png"/><meta property="article:section" content="posts" />
<meta property="article:published_time" content="2020-03-03T15:29:59+08:00" />
<meta property="article:modified_time" content="2020-03-03T15:29:59+08:00" /><meta property="og:site_name" content="KeepIt" />

<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="https://example.com/theme-documentation-mermaid-shortcode/featured-image.png"/>
<meta name="twitter:title" content="主题文档 - mermaid Shortcode"/>
<meta name="twitter:description" content="mermaid shortcode 使用 Mermaid 库提供绘制图表和流程图的功能."/>
<meta name="application-name" content="KeepIt">
<meta name="apple-mobile-web-app-title" content="KeepIt"><meta name="theme-color" content="#ffffff"><meta name="msapplication-TileColor" content="#da532c"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"><link rel="manifest" href="/site.webmanifest"><link rel="canonical" href="https://example.com/theme-documentation-mermaid-shortcode/" /><link rel="prev" href="https://example.com/emoji-support/" /><link rel="next" href="https://example.com/basic-markdown-syntax/" /><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css"><link rel="stylesheet" href="/css/style.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css"><script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "主题文档 - mermaid Shortcode",
        "inLanguage": "zh-CN",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https:\/\/example.com\/theme-documentation-mermaid-shortcode\/"
        },"image": [{
                            "@type": "ImageObject",
                            "url": "https:\/\/example.com\/theme-documentation-mermaid-shortcode\/featured-image.png",
                            "width":  1170 ,
                            "height":  497 
                        }],"genre": "posts","keywords": "shortcodes","wordcount":  722 ,
        "url": "https:\/\/example.com\/theme-documentation-mermaid-shortcode\/","datePublished": "2020-03-03T15:29:59+08:00","dateModified": "2020-03-03T15:29:59+08:00","license": "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.","publisher": {
            "@type": "Organization",
            "name": "xxxx","logo": {
                    "@type": "ImageObject",
                    "url": "https:\/\/example.com\/images\/avatar.png",
                    "width":  528 ,
                    "height":  560 
                }},"author": {
                "@type": "Person",
                "name": "Dillon"
            },"description": "mermaid shortcode 使用 Mermaid 库提供绘制图表和流程图的功能."
    }
    </script></head>
    <body data-header-desktop="fixed" data-header-mobile="auto"><script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('auto' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : 'auto' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>

        <div id="mask"></div><div class="wrapper"><header class="desktop" id="header-desktop">
    <div class="header-wrapper">
        <div class="header-title">
            <a href="/" title="KeepIt"><span class="header-title-pre"><i class='far fa-kiss-wink-heart fa-fw' aria-hidden='true'></i></span>KeepIt</a>
        </div>
        <div class="menu">
            <div class="menu-inner"><a class="menu-item" href="/posts/"> 所有文章 </a><a class="menu-item" href="/tags/"> 标签 </a><a class="menu-item" href="/categories/"> 分类 </a><a class="menu-item" href="/categories/documentation/"> 文档 </a><a class="menu-item" href="/about/"> 关于 </a><a class="menu-item" href="https://github.com/Fastbyte01/KeepIt" title="GitHub" rel="noopener noreffer" target="_blank"><i class='fab fa-github fa-fw' aria-hidden='true'></i>  </a><span class="menu-item delimiter"></span><a href="javascript:void(0);" class="menu-item language" title="选择语言">简体中文<i class="fas fa-chevron-right fa-fw" aria-hidden="true"></i>
                        <select class="language-select" id="language-select-desktop" onchange="location = this.value;"><option value="/en/theme-documentation-mermaid-shortcode/">English</option><option value="/theme-documentation-mermaid-shortcode/" selected>简体中文</option></select>
                    </a><span class="menu-item search" id="search-desktop">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-desktop">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="搜索">
                            <i class="fas fa-search fa-fw" aria-hidden="true"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="清空">
                            <i class="fas fa-times-circle fa-fw" aria-hidden="true"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-desktop">
                            <i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i>
                        </span>
                    </span><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                    <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
                </a>
            </div>
        </div>
    </div>
</header><header class="mobile" id="header-mobile">
    <div class="header-container">
        <div class="header-wrapper">
            <div class="header-title">
                <a href="/" title="KeepIt"><span class="header-title-pre"><i class='far fa-kiss-wink-heart fa-fw' aria-hidden='true'></i></span>KeepIt</a>
            </div>
            <div class="menu-toggle" id="menu-toggle-mobile">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="menu" id="menu-mobile"><div class="search-wrapper">
                    <div class="search mobile" id="search-mobile">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-mobile">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="搜索">
                            <i class="fas fa-search fa-fw" aria-hidden="true"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="清空">
                            <i class="fas fa-times-circle fa-fw" aria-hidden="true"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-mobile">
                            <i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i>
                        </span>
                    </div>
                    <a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
                        取消
                    </a>
                </div><a class="menu-item" href="/posts/" title="">所有文章</a><a class="menu-item" href="/tags/" title="">标签</a><a class="menu-item" href="/categories/" title="">分类</a><a class="menu-item" href="/categories/documentation/" title="">文档</a><a class="menu-item" href="/about/" title="">关于</a><a class="menu-item" href="https://github.com/Fastbyte01/KeepIt" title="GitHub" rel="noopener noreffer" target="_blank"><i class='fab fa-github fa-fw' aria-hidden='true'></i></a><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
            </a><a href="javascript:void(0);" class="menu-item" title="选择语言">简体中文<i class="fas fa-chevron-right fa-fw" aria-hidden="true"></i>
                    <select class="language-select" onchange="location = this.value;"><option value="/en/theme-documentation-mermaid-shortcode/">English</option><option value="/theme-documentation-mermaid-shortcode/" selected>简体中文</option></select>
                </a></div>
    </div>
</header><div class="search-dropdown desktop">
        <div id="search-dropdown-desktop"></div>
    </div>
    <div class="search-dropdown mobile">
        <div id="search-dropdown-mobile"></div>
    </div><main class="main">
                <div class="container"><div class="toc" id="toc-auto">
            <h2 class="toc-title">目录</h2>
            <div class="toc-content" id="toc-content-auto"></div>
        </div><article class="page single"><h1 class="single-title animate__animated animate__flipInX">主题文档 - mermaid Shortcode</h1><div class="post-meta">
            <div class="post-meta-line"><span class="post-author"><a href="https://dillonzq.com" title="Author" target="_blank" rel="noopener noreffer author" class="author"><i class="fas fa-user-circle fa-fw" aria-hidden="true"></i>Dillon</a>
</span>&nbsp;<span class="post-category">收录于 <a href="/categories/documentation/"><i class="far fa-folder fa-fw" aria-hidden="true"></i>文档</a></span></div>
            <div class="post-meta-line"><i class="far fa-calendar-alt fa-fw" aria-hidden="true"></i>&nbsp;<time datetime="2020-03-03">2020-03-03</time>&nbsp;<i class="fas fa-pencil-alt fa-fw" aria-hidden="true"></i>&nbsp;约 722 字&nbsp;
                <i class="far fa-clock fa-fw" aria-hidden="true"></i>&nbsp;预计阅读 2 分钟&nbsp;<span id="/theme-documentation-mermaid-shortcode/" class="leancloud_visitors" data-flag-title="主题文档 - mermaid Shortcode">
                        <i class="far fa-eye fa-fw" aria-hidden="true"></i>&nbsp;<span class=leancloud-visitors-count></span>&nbsp;次阅读
                    </span>&nbsp;</div>
        </div><div class="featured-image"><img
        class="lazyload"
        src="/svg/loading.min.svg"
        data-src="/theme-documentation-mermaid-shortcode/featured-image.png"
        data-srcset="/theme-documentation-mermaid-shortcode/featured-image.png, /theme-documentation-mermaid-shortcode/featured-image.png 1.5x, /theme-documentation-mermaid-shortcode/featured-image.png 2x"
        data-sizes="auto"
        alt="/theme-documentation-mermaid-shortcode/featured-image.png"
        title="mermaid shortcode 使用 Mermaid 库提供绘制图表和流程图的功能." /></div><div class="details toc" id="toc-static"  data-kept="">
                <div class="details-summary toc-title">
                    <span>目录</span>
                    <span><i class="details-icon fas fa-angle-right" aria-hidden="true"></i></span>
                </div>
                <div class="details-content toc-content" id="toc-content-static"><nav id="TableOfContents">
  <ul>
    <li><a href="#flowchart">流程图</a></li>
    <li><a href="#sequence-diagram">时序图</a></li>
    <li><a href="#gantt">甘特图</a></li>
    <li><a href="#class-diagram">类图</a></li>
    <li><a href="#state-diagram">状态图</a></li>
    <li><a href="#git-graph">Git 图</a></li>
    <li><a href="#entity-relationship-diagram">实体关系图</a></li>
    <li><a href="#user-journey">用户体验旅程图</a></li>
    <li><a href="#pie">饼图</a></li>
    <li><a href="#requirement-diagram">依赖图</a></li>
  </ul>
</nav></div>
            </div><div class="content" id="content"><a href="https://github.com/Fastbyte01/KeepIt/releases/tag/v0.2.11" rel="noopener noreffer" target="_blank"><img
        class="lazyload version"
        src="/svg/loading.min.svg"
        data-src="/svg/version/0.2.11-changed.zh-cn.min.svg"
        data-srcset="/svg/version/0.2.11-changed.zh-cn.min.svg, /svg/version/0.2.11-changed.zh-cn.min.svg 1.5x, /svg/version/0.2.11-changed.zh-cn.min.svg 2x"
        data-sizes="auto"
        alt="KeepIt 更改 | 0.2.11"
        title="KeepIt 更改 | 0.2.11" /></a>
<p><code>mermaid</code> shortcode 使用 <a href="https://mermaidjs.github.io/" target="_blank" rel="noopener noreffer">Mermaid</a>
 库提供绘制图表和流程图的功能.</p>
<p><a href="https://mermaidjs.github.io/" target="_blank" rel="noopener noreffer">mermaid</a>
 是一个可以帮助你在文章中绘制图表和流程图的库, 类似 Markdown 的语法.</p>
<p>只需将你的 mermaid 代码插入 <code>mermaid</code> shortcode 中即可.</p>
<h2 id="flowchart">流程图</h2>
<p>一个 <strong>流程图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">graph LR;
</span></span><span class="line"><span class="cl">    A[Hard edge] --&gt;|Link text| B(Round edge)
</span></span><span class="line"><span class="cl">    B --&gt; C{Decision}
</span></span><span class="line"><span class="cl">    C --&gt;|One| D[Result one]
</span></span><span class="line"><span class="cl">    C --&gt;|Two| E[Result two]
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-1"></div>
<h2 id="sequence-diagram">时序图</h2>
<p>一个 <strong>时序图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">sequenceDiagram
</span></span><span class="line"><span class="cl">    participant Alice
</span></span><span class="line"><span class="cl">    participant Bob
</span></span><span class="line"><span class="cl">    Alice-&gt;&gt;John: Hello John, how are you?
</span></span><span class="line"><span class="cl">    loop Healthcheck
</span></span><span class="line"><span class="cl">        John-&gt;John: Fight against hypochondria
</span></span><span class="line"><span class="cl">    end
</span></span><span class="line"><span class="cl">    Note right of John: Rational thoughts <span class="p">&lt;</span><span class="nt">br</span><span class="p">/&gt;</span>prevail...
</span></span><span class="line"><span class="cl">    John--&gt;Alice: Great!
</span></span><span class="line"><span class="cl">    John-&gt;Bob: How about you?
</span></span><span class="line"><span class="cl">    Bob--&gt;John: Jolly good!
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-2"></div>
<h2 id="gantt">甘特图</h2>
<p>一个 <strong>甘特图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">gantt
</span></span><span class="line"><span class="cl">dateFormat  YYYY-MM-DD
</span></span><span class="line"><span class="cl">title Adding GANTT diagram to mermaid
</span></span><span class="line"><span class="cl">excludes weekdays 2014-01-10
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">section A section
</span></span><span class="line"><span class="cl">Completed task            :done,    des1, 2014-01-06,2014-01-08
</span></span><span class="line"><span class="cl">Active task               :active,  des2, 2014-01-09, 3d
</span></span><span class="line"><span class="cl">Future task               :         des3, after des2, 5d
</span></span><span class="line"><span class="cl">Future task2              :         des4, after des3, 5d
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-3"></div>
<h2 id="class-diagram">类图</h2>
<p>一个 <strong>类图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">classDiagram
</span></span><span class="line"><span class="cl">    Animal <span class="err">&lt;</span>|-- Duck
</span></span><span class="line"><span class="cl">    Animal <span class="err">&lt;</span>|-- Fish
</span></span><span class="line"><span class="cl">    Animal <span class="err">&lt;</span>|-- Zebra
</span></span><span class="line"><span class="cl">    Animal : +int age
</span></span><span class="line"><span class="cl">    Animal : +String gender
</span></span><span class="line"><span class="cl">    Animal: +isMammal()
</span></span><span class="line"><span class="cl">    Animal: +mate()
</span></span><span class="line"><span class="cl">    class Duck{
</span></span><span class="line"><span class="cl">        +String beakColor
</span></span><span class="line"><span class="cl">        +swim()
</span></span><span class="line"><span class="cl">        +quack()
</span></span><span class="line"><span class="cl">    }
</span></span><span class="line"><span class="cl">    class Fish{
</span></span><span class="line"><span class="cl">        -int sizeInFeet
</span></span><span class="line"><span class="cl">        -canEat()
</span></span><span class="line"><span class="cl">    }
</span></span><span class="line"><span class="cl">    class Zebra{
</span></span><span class="line"><span class="cl">        +bool is_wild
</span></span><span class="line"><span class="cl">        +run()
</span></span><span class="line"><span class="cl">    }
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-4"></div>
<h2 id="state-diagram">状态图</h2>
<p>一个 <strong>状态图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span><span class="lnt">8
</span><span class="lnt">9
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">stateDiagram-v2
</span></span><span class="line"><span class="cl">    [*] --&gt; Still
</span></span><span class="line"><span class="cl">    Still --&gt; [*]
</span></span><span class="line"><span class="cl">    Still --&gt; Moving
</span></span><span class="line"><span class="cl">    Moving --&gt; Still
</span></span><span class="line"><span class="cl">    Moving --&gt; Crash
</span></span><span class="line"><span class="cl">    Crash --&gt; [*]
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-5"></div>
<h2 id="git-graph">Git 图</h2>
<p>一个 <strong>Git 图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">gitGraph
</span></span><span class="line"><span class="cl">    commit
</span></span><span class="line"><span class="cl">    commit
</span></span><span class="line"><span class="cl">    branch develop
</span></span><span class="line"><span class="cl">    checkout develop
</span></span><span class="line"><span class="cl">    commit
</span></span><span class="line"><span class="cl">    commit
</span></span><span class="line"><span class="cl">    checkout main
</span></span><span class="line"><span class="cl">    merge develop
</span></span><span class="line"><span class="cl">    commit
</span></span><span class="line"><span class="cl">    commit
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-6"></div>
<h2 id="entity-relationship-diagram">实体关系图</h2>
<p>一个 <strong>实体关系图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">erDiagram
</span></span><span class="line"><span class="cl">    CUSTOMER ||--o{ ORDER : places
</span></span><span class="line"><span class="cl">    ORDER ||--|{ LINE-ITEM : contains
</span></span><span class="line"><span class="cl">    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-7"></div>
<h2 id="user-journey">用户体验旅程图</h2>
<p>一个 <strong>用户体验旅程图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">journey
</span></span><span class="line"><span class="cl">    title My working day
</span></span><span class="line"><span class="cl">    section Go to work
</span></span><span class="line"><span class="cl">      Make tea: 5: Me
</span></span><span class="line"><span class="cl">      Go upstairs: 3: Me
</span></span><span class="line"><span class="cl">      Do work: 1: Me, Cat
</span></span><span class="line"><span class="cl">    section Go home
</span></span><span class="line"><span class="cl">      Go downstairs: 5: Me
</span></span><span class="line"><span class="cl">      Sit down: 5: Me
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-8"></div>
<h2 id="pie">饼图</h2>
<p>一个 <strong>饼图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">pie
</span></span><span class="line"><span class="cl">    &#34;Dogs&#34; : 386
</span></span><span class="line"><span class="cl">    &#34;Cats&#34; : 85
</span></span><span class="line"><span class="cl">    &#34;Rats&#34; : 15
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-9"></div>
<h2 id="requirement-diagram">依赖图</h2>
<p>一个 <strong>依赖图</strong> <code>mermaid</code> 示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span><span class="line"><span class="cl">requirementDiagram
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">requirement test_req {
</span></span><span class="line"><span class="cl">id: 1
</span></span><span class="line"><span class="cl">text: the test text.
</span></span><span class="line"><span class="cl">risk: high
</span></span><span class="line"><span class="cl">verifymethod: test
</span></span><span class="line"><span class="cl">}
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">element test_entity {
</span></span><span class="line"><span class="cl">type: simulation
</span></span><span class="line"><span class="cl">}
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">test_entity - satisfies -&gt; test_req
</span></span><span class="line"><span class="cl">{{<span class="p">&lt;</span> <span class="p">/</span><span class="nt">mermaid</span> <span class="p">&gt;</span>}}
</span></span></code></pre></td></tr></table>
</div>
</div><p>呈现的输出效果如下:</p>
<div class="mermaid" id="id-10"></div></div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>更新于 2020-03-03</span>
            </div></div>
        <div class="post-info-line">
            <div class="post-info-md"><span>
                            <a class="link-to-markdown" href="/theme-documentation-mermaid-shortcode/index.md" target="_blank">阅读原始文档</a>
                        </span></div>
            <div class="post-info-share">
                <span><a href="javascript:void(0);" title="分享到 Twitter" data-sharer="twitter" data-url="https://example.com/theme-documentation-mermaid-shortcode/" data-title="主题文档 - mermaid Shortcode" data-hashtags="shortcodes"><i class="fab fa-twitter fa-fw" aria-hidden="true"></i></a><a href="javascript:void(0);" title="分享到 Facebook" data-sharer="facebook" data-url="https://example.com/theme-documentation-mermaid-shortcode/" data-hashtag="shortcodes"><i class="fab fa-facebook-square fa-fw" aria-hidden="true"></i></a><a href="javascript:void(0);" title="分享到 Hacker News" data-sharer="hackernews" data-url="https://example.com/theme-documentation-mermaid-shortcode/" data-title="主题文档 - mermaid Shortcode"><i class="fab fa-hacker-news fa-fw" aria-hidden="true"></i></a><a href="javascript:void(0);" title="分享到 Line" data-sharer="line" data-url="https://example.com/theme-documentation-mermaid-shortcode/" data-title="主题文档 - mermaid Shortcode"><i data-svg-src="https://cdn.jsdelivr.net/npm/simple-icons@6.20.0/icons/line.svg" aria-hidden="true"></i></a><a href="javascript:void(0);" title="分享到 微博" data-sharer="weibo" data-url="https://example.com/theme-documentation-mermaid-shortcode/" data-title="主题文档 - mermaid Shortcode" data-ralateuid="xxxx"><i class="fab fa-weibo fa-fw" aria-hidden="true"></i></a></span>
            </div>
        </div>
    </div>

    <div class="post-info-more">
        <section class="post-tags"><i class="fas fa-tags fa-fw" aria-hidden="true"></i>&nbsp;<a href="/tags/shortcodes/">shortcodes</a></section>
        <section>
            <span><a href="javascript:void(0);" onclick="window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="/">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="/emoji-support/" class="prev" rel="prev" title="Emoji 支持"><i class="fas fa-angle-left fa-fw" aria-hidden="true"></i>Emoji 支持</a>
            <a href="/basic-markdown-syntax/" class="next" rel="next" title="Markdown 基本语法">Markdown 基本语法<i class="fas fa-angle-right fa-fw" aria-hidden="true"></i></a></div>
</div>
<div id="comments"><div id="valine" class="comment"></div><noscript>
                Please enable JavaScript to view the comments powered by <a href="https://valine.js.org/">Valine</a>.
            </noscript></div></article></div>
            </main><footer class="footer">
        <div class="footer-container"><div class="footer-line">由 <a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo 0.121.0-DEV">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/Fastbyte01/KeepIt" target="_blank" rel="noopener noreffer" title="KeepIt 0.2.10"><i class="far fa-kiss-wink-heart fa-fw" aria-hidden="true"></i> KeepIt</a>
                </div><div class="footer-line" itemscope itemtype="http://schema.org/CreativeWork"><i class="far fa-copyright fa-fw" aria-hidden="true"></i><span itemprop="copyrightYear">2019 - 2023</span><span class="author" itemprop="copyrightHolder">&nbsp;<a href="/" target="_blank">xxxx</a></span>&nbsp;|&nbsp;<span class="license"><a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a></span></div>
        </div>
    </footer></div>

        <div id="fixed-buttons"><a href="#" id="back-to-top" class="fixed-button" title="回到顶部">
                <i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i>
            </a><a href="#" id="view-comments" class="fixed-button" title="查看评论">
                <i class="fas fa-comment fa-fw" aria-hidden="true"></i>
            </a>
        </div><link rel="stylesheet" href="/lib/valine/valine.min.css"><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/valine@1.4.18/dist/Valine.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/autocomplete.js@0.38.1/dist/autocomplete.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/algoliasearch@4.13.0/dist/algoliasearch-lite.umd.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lazysizes@5.3.1/lazysizes.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sharer.js@0.5.1/sharer.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mermaid@9.1.0/dist/mermaid.min.js"></script><script type="text/javascript">window.config={"code":{"copyTitle":"复制到剪贴板","maxShownLines":50},"comment":{"valine":{"appId":"QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI","appKey":"WBmoGyJtbqUswvfLh6L8iEBr","avatar":"mp","el":"#valine","emojiCDN":"https://cdn.jsdelivr.net/npm/emoji-datasource-google@14.0.0/img/google/64/","emojiMaps":{"100":"1f4af.png","alien":"1f47d.png","anger":"1f4a2.png","angry":"1f620.png","anguished":"1f627.png","astonished":"1f632.png","black_heart":"1f5a4.png","blue_heart":"1f499.png","blush":"1f60a.png","bomb":"1f4a3.png","boom":"1f4a5.png","broken_heart":"1f494.png","brown_heart":"1f90e.png","clown_face":"1f921.png","cold_face":"1f976.png","cold_sweat":"1f630.png","confounded":"1f616.png","confused":"1f615.png","cry":"1f622.png","crying_cat_face":"1f63f.png","cupid":"1f498.png","dash":"1f4a8.png","disappointed":"1f61e.png","disappointed_relieved":"1f625.png","dizzy":"1f4ab.png","dizzy_face":"1f635.png","drooling_face":"1f924.png","exploding_head":"1f92f.png","expressionless":"1f611.png","face_vomiting":"1f92e.png","face_with_cowboy_hat":"1f920.png","face_with_hand_over_mouth":"1f92d.png","face_with_head_bandage":"1f915.png","face_with_monocle":"1f9d0.png","face_with_raised_eyebrow":"1f928.png","face_with_rolling_eyes":"1f644.png","face_with_symbols_on_mouth":"1f92c.png","face_with_thermometer":"1f912.png","fearful":"1f628.png","flushed":"1f633.png","frowning":"1f626.png","ghost":"1f47b.png","gift_heart":"1f49d.png","green_heart":"1f49a.png","grimacing":"1f62c.png","grin":"1f601.png","grinning":"1f600.png","hankey":"1f4a9.png","hear_no_evil":"1f649.png","heart":"2764-fe0f.png","heart_decoration":"1f49f.png","heart_eyes":"1f60d.png","heart_eyes_cat":"1f63b.png","heartbeat":"1f493.png","heartpulse":"1f497.png","heavy_heart_exclamation_mark_ornament":"2763-fe0f.png","hole":"1f573-fe0f.png","hot_face":"1f975.png","hugging_face":"1f917.png","hushed":"1f62f.png","imp":"1f47f.png","innocent":"1f607.png","japanese_goblin":"1f47a.png","japanese_ogre":"1f479.png","joy":"1f602.png","joy_cat":"1f639.png","kiss":"1f48b.png","kissing":"1f617.png","kissing_cat":"1f63d.png","kissing_closed_eyes":"1f61a.png","kissing_heart":"1f618.png","kissing_smiling_eyes":"1f619.png","laughing":"1f606.png","left_speech_bubble":"1f5e8-fe0f.png","love_letter":"1f48c.png","lying_face":"1f925.png","mask":"1f637.png","money_mouth_face":"1f911.png","nauseated_face":"1f922.png","nerd_face":"1f913.png","neutral_face":"1f610.png","no_mouth":"1f636.png","open_mouth":"1f62e.png","orange_heart":"1f9e1.png","partying_face":"1f973.png","pensive":"1f614.png","persevere":"1f623.png","pleading_face":"1f97a.png","pouting_cat":"1f63e.png","purple_heart":"1f49c.png","rage":"1f621.png","relaxed":"263a-fe0f.png","relieved":"1f60c.png","revolving_hearts":"1f49e.png","right_anger_bubble":"1f5ef-fe0f.png","robot_face":"1f916.png","rolling_on_the_floor_laughing":"1f923.png","scream":"1f631.png","scream_cat":"1f640.png","see_no_evil":"1f648.png","shushing_face":"1f92b.png","skull":"1f480.png","skull_and_crossbones":"2620-fe0f.png","sleeping":"1f634.png","sleepy":"1f62a.png","slightly_frowning_face":"1f641.png","slightly_smiling_face":"1f642.png","smile":"1f604.png","smile_cat":"1f638.png","smiley":"1f603.png","smiley_cat":"1f63a.png","smiling_face_with_3_hearts":"1f970.png","smiling_imp":"1f608.png","smirk":"1f60f.png","smirk_cat":"1f63c.png","sneezing_face":"1f927.png","sob":"1f62d.png","space_invader":"1f47e.png","sparkling_heart":"1f496.png","speak_no_evil":"1f64a.png","speech_balloon":"1f4ac.png","star-struck":"1f929.png","stuck_out_tongue":"1f61b.png","stuck_out_tongue_closed_eyes":"1f61d.png","stuck_out_tongue_winking_eye":"1f61c.png","sunglasses":"1f60e.png","sweat":"1f613.png","sweat_drops":"1f4a6.png","sweat_smile":"1f605.png","thinking_face":"1f914.png","thought_balloon":"1f4ad.png","tired_face":"1f62b.png","triumph":"1f624.png","two_hearts":"1f495.png","unamused":"1f612.png","upside_down_face":"1f643.png","weary":"1f629.png","white_frowning_face":"2639-fe0f.png","white_heart":"1f90d.png","wink":"1f609.png","woozy_face":"1f974.png","worried":"1f61f.png","yawning_face":"1f971.png","yellow_heart":"1f49b.png","yum":"1f60b.png","zany_face":"1f92a.png","zipper_mouth_face":"1f910.png","zzz":"1f4a4.png"},"enableQQ":false,"highlight":true,"lang":"zh-cn","pageSize":10,"placeholder":"你的评论 ...","recordIP":true,"serverURLs":"https://leancloud.xxxxx.com","visitor":true}},"data":{"id-1":"graph LR;\n    A[Hard edge] --\u003e|Link text| B(Round edge)\n    B --\u003e C{Decision}\n    C --\u003e|One| D[Result one]\n    C --\u003e|Two| E[Result two]","id-10":"requirementDiagram\n\nrequirement test_req {\nid: 1\ntext: the test text.\nrisk: high\nverifymethod: test\n}\n\nelement test_entity {\ntype: simulation\n}\n\ntest_entity - satisfies -\u003e test_req","id-2":"sequenceDiagram\n    participant Alice\n    participant Bob\n    Alice-\u003e\u003eJohn: Hello John, how are you?\n    loop Healthcheck\n        John-\u003eJohn: Fight against hypochondria\n    end\n    Note right of John: Rational thoughts \u003cbr/\u003eprevail...\n    John--\u003eAlice: Great!\n    John-\u003eBob: How about you?\n    Bob--\u003eJohn: Jolly good!","id-3":"gantt\ndateFormat  YYYY-MM-DD\ntitle Adding GANTT diagram to mermaid\nexcludes weekdays 2014-01-10\n\nsection A section\nCompleted task            :done,    des1, 2014-01-06,2014-01-08\nActive task               :active,  des2, 2014-01-09, 3d\nFuture task               :         des3, after des2, 5d\nFuture task2              :         des4, after des3, 5d","id-4":"classDiagram\n    Animal \u003c|-- Duck\n    Animal \u003c|-- Fish\n    Animal \u003c|-- Zebra\n    Animal : +int age\n    Animal : +String gender\n    Animal: +isMammal()\n    Animal: +mate()\n    class Duck{\n        +String beakColor\n        +swim()\n        +quack()\n    }\n    class Fish{\n        -int sizeInFeet\n        -canEat()\n    }\n    class Zebra{\n        +bool is_wild\n        +run()\n    }","id-5":"stateDiagram-v2\n    [*] --\u003e Still\n    Still --\u003e [*]\n    Still --\u003e Moving\n    Moving --\u003e Still\n    Moving --\u003e Crash\n    Crash --\u003e [*]","id-6":"gitGraph\n    commit\n    commit\n    branch develop\n    checkout develop\n    commit\n    commit\n    checkout main\n    merge develop\n    commit\n    commit","id-7":"erDiagram\n    CUSTOMER ||--o{ ORDER : places\n    ORDER ||--|{ LINE-ITEM : contains\n    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses","id-8":"journey\n    title My working day\n    section Go to work\n      Make tea: 5: Me\n      Go upstairs: 3: Me\n      Do work: 1: Me, Cat\n    section Go home\n      Go downstairs: 5: Me\n      Sit down: 5: Me","id-9":"pie\n    \"Dogs\" : 386\n    \"Cats\" : 85\n    \"Rats\" : 15"},"search":{"algoliaAppID":"PASDMWALPK","algoliaIndex":"index.zh-cn","algoliaSearchKey":"b42948e51daaa93df92381c8e2ac0f93","highlightTag":"em","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":50,"type":"algolia"}};</script><script type="text/javascript" src="/js/theme.min.js"></script></body>
</html>
